<template>
    <div>
        <ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media" v-for="item in newlist" :key="item.id">
					<router-link :to="'/home/newsinfo/'+item.id">
						<img class="mui-media-object mui-pull-left" src="https://ss0.baidu.com/6ONWsjip0QIZ8tyhnq/it/u=3857580939,486156895&fm=85&app=58&f=JPEG?w=121&h=75&s=5700B944E6AA76BCCCAD2D1C03008062">
						<div class="mui-media-body">
							幸福
							<p class="mui-ellipsis">能和心爱的人一起睡觉，是件幸福的事情；可是，打呼噜怎么办？</p>
						</div>
					</router-link>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-left" src="https://ss0.bdstatic.com/k4oZeXSm1A5BphGlnYG/icon/weather/aladdin/jpg/a0.jpg">
						<div class="mui-media-body">
							木屋
							<p class="mui-ellipsis">想要这样一间小木屋，夏天挫冰吃瓜，冬天围炉取暖.</p>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-left" src="https://ss0.bdstatic.com/k4oZeXSm1A5BphGlnYG/icon/weather/aladdin/jpg/a0.jpg">
						<div class="mui-media-body">
							CBD
							<p class="mui-ellipsis">烤炉模式的城，到黄昏，如同打翻的调色盘一般.</p>
						</div>
					</a>
				</li>

			</ul>
    </div>
</template>

<script>
import {Toast} from 'mint-ui'
export default {
	data(){
		return {
			// 数组用来v-for的
			newlist:[
				{id:1},
				{id:2},
				{id:3},
				{id:4}
			]
		}
	},
	// created(){
	// 	this.getnewlist()
	// },
	methods:{
		getnewlist(){
			this.$http.get("http://vue.studyit.io/api/getlunbo").then(result=>{
				if(result.body.status===0){
					this.newlist=result.body.message
				}else{
					Toast('获取新闻列表失败')
				}
			})
		}
	}
    
}
</script>

<style lang="scss" scoped>

</style>
